package cn.hnu.jpa.jpaExample.Composite_primary_key;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import org.junit.Test;

public class UnitTest {

	//@Test
	public void test() {
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpa");
		EntityManager em = emf.createEntityManager();
		em.getTransaction().begin();
		CustomerPK cpk = new CustomerPK("123","zdc");
		IDClassTest id = new IDClassTest();
		id.setEmail("123");
		id.setName("zdc");
		em.persist(id);
		System.out.println(em.find(IDClassTest.class, cpk));
		em.getTransaction().commit();
		em.close();
		emf.close(); 
	}

}
